package ute.mvc.dto;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import ute.mvc.model.SubmittedTestAndQuizz;
import ute.mvc.util.DateTimeSerializer;

public class SubmittedTestDTO {
	private String submittedTestAndQuizzId;
	
	@JsonSerialize(using = DateTimeSerializer.class)
	@DateTimeFormat(pattern = "dd/MM/yyyy hh:mm:ss")
	private Date startTime;
	
	@JsonSerialize(using = DateTimeSerializer.class)
	@DateTimeFormat(pattern = "dd/MM/yyyy hh:mm:ss")
	private Date submittedTime;
	private float point;
	private String testAndQuizzName;

	public SubmittedTestDTO(SubmittedTestAndQuizz submitted) {
		submittedTestAndQuizzId = submitted.getSubmittedTestAndQuizzId();
		startTime = submitted.getStartTime();
		submittedTime = submitted.getSubmittedTime();
		point = submitted.getPoint();
		testAndQuizzName = submitted.getTestAndQuizz_student()
				.getTestAndQuizz().getTestAndQuizzName();
	}

	public String getSubmittedTestAndQuizzId() {
		return submittedTestAndQuizzId;
	}

	public void setSubmittedTestAndQuizzId(String submittedTestAndQuizzId) {
		this.submittedTestAndQuizzId = submittedTestAndQuizzId;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getSubmittedTime() {
		return submittedTime;
	}

	public void setSubmittedTime(Date submittedTime) {
		this.submittedTime = submittedTime;
	}

	public float getPoint() {
		return point;
	}

	public void setPoint(float point) {
		this.point = point;
	}

	public String getTestAndQuizzName() {
		return testAndQuizzName;
	}

	public void setTestAndQuizzName(String testAndQuizzName) {
		this.testAndQuizzName = testAndQuizzName;
	}
}
